Skip to main content

Firestore to BigQuery Validation Workflow

This document provides a step-by-step guide to run the GitHub Actions workflow for validating Firestore data against BigQuery schema and data.


๐Ÿ“Œ Overviewโ€‹

The GitHub Actions workflow titled:

<env> โ€“ Firestore to BigQuery Enquiry Validation (Schema/Data)

is used to:

  • โœ… Validate Firestore data against BigQuery schema.
  • โœ… Validate Firestore data against BigQuery data.

๐Ÿ” The same workflow handles both schema and data validation. You can select the mode using the validationType input.


๐Ÿงญ Navigate & Launch the Workflowโ€‹

1. Open the GitHub Repositoryโ€‹

Go to the visn-devops-scripts repository.

2. Access the Workflowโ€‹

  • Click the Actions tab.
  • Select the workflow named:
    <env> โ€“ Firestore to BigQuery Enquiry Validation (Schema/Data)

3. Run the Workflowโ€‹

  • Click the Run workflow button (top-right).
  • Select the target branch (e.g., sprint123-feature-narwhal).
  • A form will appear with input fields.

๐Ÿงพ Required Inputsโ€‹

The form requires the following parameters:

ParameterRequiredDescription
Lease Company IDโœ…Firestore document ID for the leasing company.
Account IDโœ…The account ID.
Service Unit IDโœ…ID of the service unit related to the enquiry.
Enquiry IDโœ…Firestore document ID of the enquiry to validate.
Validation Typeโœ…Select either schema or data based on what you want to validate.
Generate Schema if Fields Missingโš ๏ธ Only for schemaWhen set to true, the script auto-generates missing fields BigQuery schema. If false, it only reports them.

โš ๏ธ The "Generate Schema" field only appears when validationType is set to schema.


โœ… Validation Modesโ€‹

๐Ÿ” 1. Schema Validation (validationType = schema)โ€‹

This mode checks whether the Firestore document fields match the BigQuery schema.

You will be prompted with:

Generate schema if fields are missing?

Choose:

  • true โ†’ The workflow will automatically generate the missing fields schema.
  • false โ†’ The workflow will only report missing fields without altering the schema.

๐Ÿ” 2. Data Validation (validationType = data)โ€‹

This mode checks that the values in Firestore documents exist in BigQuery and match exactly. It detects:

  • Missing documents
  • Mismatched values

โ–ถ๏ธ Executing the Workflowโ€‹

Once all input fields are completed:

  1. Click Run workflow again to start execution.
  2. GitHub Actions will queue and run the job with your selected parameters.

๐Ÿ“Š Reviewing the Resultsโ€‹

1. Open the Workflow Runโ€‹

  • Go to the Actions tab.
  • Select the recent run of the workflow under your branch and environment.

2. Locate the Validation Stepโ€‹

Find the step titled: Run Firestore Validator based on selected validation type

3. Analyze the Logsโ€‹

If validationType = schema:โ€‹

  • Logs will show:
    • Logs will list any missing fields.
    • Youโ€™ll see if fields were auto-generated (if enabled).

Auto-generated Schema:

If validationType = data:โ€‹

  • Logs will show:

    • Fields present in Firestore but missing in BigQuery.
    • Mismatched values between Firestore and BigQuery rows.

๐Ÿ–ผ๏ธ UI Referenceโ€‹

Below is an example of how the workflow input form appears in GitHub Actions:

Run Firestore to BigQuery Validation Workflow

Features visible in the UI:

  • Workflow name with environment: DEV โ€“ Firestore to BigQuery Enquiry Validation (Schema/Data)
  • Manual branch selector (e.g., sprint123-feature-narwhal)
  • Input fields for:
    • Lease Company ID
    • Account ID
    • Service Unit ID
    • Enquiry ID
    • Validation Type
    • Schema generation toggle (for schema validation)

๐Ÿ’ก Tipsโ€‹

  • Always verify you're selecting the correct environment and branch before running.

๐Ÿ“˜ Notesโ€‹

  • <env> refers to your environment: DEV, DEMO, or PROD.
  • Only users with appropriate permissions can trigger workflows and view logs.
  • Schema generation is not available in data mode.

Status: Approved
Category: Protected
Authored By: Jeyakumar Arunagiri on July 14, 2025